package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.RepOrderClientBack;
import cn.cs.pojo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = RepOrderClientBack.class)
public interface RestRepOrderClient {
    @RequestMapping(value = "/insertRepOrder", method = RequestMethod.POST)
    int insertRepOrder(@RequestBody  RepOrder order);
    @RequestMapping(value = "/getOrdersByDate", method = RequestMethod.POST)
    List<RepOrder> getOrdersByDate(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/updateRepOrderIsAppset", method = RequestMethod.POST)
    int updateRepOrderIsAppset(@RequestBody RepOrder m);
    @RequestMapping(value = "/getRepOrderByAppOrderId", method = RequestMethod.POST)
    RepOrder getRepOrderByAppOrderId(@RequestParam("id")String id);
    @RequestMapping(value = "/getAllRepOrders", method = RequestMethod.POST)
    List<RepOrder> getAllRepOrders(@RequestBody Map<String, Object> parm);
    @RequestMapping(value = "/getRepOrderById", method = RequestMethod.POST)
    RepOrder getRepOrderById(@RequestParam("id")String id);
    @RequestMapping(value = "/getRepProsByOrderId", method = RequestMethod.POST)
    List<RepProduct> getRepProsByOrderId(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/getAllrepEva", method = RequestMethod.POST)
    List<Map<String,Object>> getAllrepEva(@RequestParam("id") String id);
    @RequestMapping(value = "/insertQrHistory", method = RequestMethod.POST)
    void insertQrHistory(@RequestBody QrHistory qrHistory);
    @RequestMapping(value = "/insertRepProduct", method = RequestMethod.POST)
    void insertRepProduct(@RequestBody RepProduct repProduct);
    @RequestMapping(value = "/getRepairPercentage", method = RequestMethod.POST)
    Map<String,Object> getRepairPercentage();
    @RequestMapping(value = "/updateRepOrder", method = RequestMethod.POST)
    int updateRepOrder(@RequestBody RepOrder repOrder);
    @RequestMapping(value = "/insertOrderBillImg", method = RequestMethod.POST)
    void insertOrderBillImg(@RequestBody Map<String, Object> map);
    @RequestMapping(value = "/insertTestReport", method = RequestMethod.POST)
    int insertTestReport(@RequestBody RepairTestReport testReport);
    @RequestMapping(value = "/getRepProTypes", method = RequestMethod.POST)
    List<Map<String,Object>> getRepProTypes();
    @RequestMapping(value = "/getRepProTypesById", method = RequestMethod.POST)
    List<Map<String,Object>> getRepProTypesById(String typeId);
    @RequestMapping(value = "/getQrHistoryByQrCode", method = RequestMethod.POST)
    List<Map<String,Object>> getQrHistoryByQrCode(@RequestParam("qrCode") String qrCode);
    @RequestMapping(value = "/getTestReportByOrderId", method = RequestMethod.POST)
    RepairTestReport getTestReportByOrderId(@RequestParam("orderId") String orderId);
    @RequestMapping(value = "/getTestReportImgsById", method = RequestMethod.POST)
    List<Map<String,Object>> getTestReportImgsById(@RequestParam("id") String id);
    @RequestMapping(value = "/insertRepImg", method = RequestMethod.POST)
    void insertRepImg(@RequestBody Map<String, Object> map);
    @RequestMapping(value = "/getBillOrderImg", method = RequestMethod.POST)
    List<Map<String,Object>> getBillOrderImg(@RequestParam("orderId")String orderId);
    @RequestMapping(value = "/getHbRepOrderList", method = RequestMethod.POST)
    List<Map<String,Object>> getHbRepOrderList(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/getRepOrderEvlById", method = RequestMethod.POST)
    Map<String,Object> getRepOrderEvlById(@RequestParam("orderId")String orderId);


    @RequestMapping(value = "/updateRepairPercentage", method = RequestMethod.POST)
    public Integer updateRepairPercentage(@RequestBody Map<String,Object> map) throws  Exception;

    @RequestMapping(value = "/getOrderDetailsByOrderId", method = RequestMethod.POST)
    public List<Map<String, Object>> getOrderDetailsByOrderId(@RequestParam("orderId") String orderId, @RequestParam("type") String type);

    @RequestMapping(value = "/getOrderInvoiceByUserId", method = RequestMethod.POST)
    public List<Map<String, Object>>getOrderInvoiceByUserId(@RequestParam("userId") String userId, @RequestParam("phone") String phone)throws Exception;

    @RequestMapping(value = "/updateOrderByIds", method = RequestMethod.POST)
    public int updateOrderByIds(@RequestBody String[] params)throws Exception;

    @RequestMapping(value = "/getOrderInvoiceByUserPId", method = RequestMethod.POST)
    public List<Map<String, Object>>getOrderInvoiceByUserPId(@RequestParam("userId") String userId)throws Exception;

    @RequestMapping(value = "/updateRepOrderBillState", method = RequestMethod.POST)
    int  updateRepOrderBillState(@RequestBody RepOrder repOrder);
    @RequestMapping(value = "/getServiceType", method = RequestMethod.POST)
    List<Map<String,Object>> getServiceType();
    @RequestMapping(value = "/getFaultType", method = RequestMethod.POST)
    List<Map<String,Object>> getFaultType(@RequestParam("id") String id);

    @RequestMapping(value = "/getMyEarningsByDay", method = RequestMethod.POST)
    List<Map<String,Object>> getMyEarningsByDay(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getCountMyEarnings", method = RequestMethod.POST)
    List<Map<String,Object>> getCountMyEarnings(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getSetMoney", method = RequestMethod.POST)
    String getSetMoney(@RequestBody Map<String, Object> param);
}
